package com.zhongxiangspace.service.impl;

import com.zhongxiangspace.entity.BuildingsAttribute;
import com.zhongxiangspace.entity.OfficeBuildings;
import com.zhongxiangspace.entity.QueryAnalyzer;
import com.zhongxiangspace.entity.VO.OfficeBHVO;
import com.zhongxiangspace.entity.VO.QueryAnalyzerOffice;
import com.zhongxiangspace.mapper.OfficeBuildingMapper;
import com.zhongxiangspace.service.OfficeBuildingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * 办公楼
 */
@Service
public class OfficeBuildingServiceImpl implements OfficeBuildingService {

    @Autowired
    private OfficeBuildingMapper officeBuildingMapper;

    /**
     * 插入data
     *
     * @param officeBuildings
     * @return
     */
    @Override
    public boolean insert(OfficeBuildings officeBuildings) {
        return this.officeBuildingMapper.insert(officeBuildings);
    }

    /**
     * 获取data
     *
     * @param queryAnalyzer 条件
     * @return
     */
    @Override
    public List<OfficeBuildings> queryByQueryAnalyzer(QueryAnalyzer queryAnalyzer) {
        return this.officeBuildingMapper.queryByQueryAnalyzer(queryAnalyzer);
    }

    /**
     * 获取单条data
     *
     * @param id
     * @return
     */
    @Override
    public OfficeBuildings queryOne(Integer id) {
        return this.officeBuildingMapper.queryOne(id);
    }

    /**
     * 更新状态
     *
     * @param officeBuildings
     * @return
     */
    @Override
    public boolean updataStatusCode(OfficeBuildings officeBuildings) {
        return this.officeBuildingMapper.updataStatusCode(officeBuildings);
    }

    /**
     * @param officeBuildings 是否热门
     * @return
     */
    @Override
    public boolean updataHotCode(OfficeBuildings officeBuildings) {
        return this.officeBuildingMapper.updataHotCode(officeBuildings);
    }

    /**
     * 逻辑删除
     *
     * @param id
     * @return
     */
    @Override
    public boolean delete(Integer id) {
        return this.officeBuildingMapper.delete(id);
    }

    /**
     * 更新data
     *
     * @param office
     * @return
     */
    @Override
    public boolean updata(OfficeBuildings office) {
        return this.officeBuildingMapper.updata(office);
    }

    /**
     * 查询楼盘属性
     *
     * @param building_id 楼盘id
     * @return
     */
    @Override
    public BuildingsAttribute queryAttr(Integer building_id) {
        return this.officeBuildingMapper.queryAttr(building_id);
    }

    /**
     *  更新属性data
     * @param buildingsAttribute 属性
     * @return
     */
    @Override
    public boolean updataAttr(BuildingsAttribute buildingsAttribute) {
            return this.officeBuildingMapper.updataAttr(buildingsAttribute);
    }
    /**
     * 插入属性data
     * @param buildingsAttribute 属性
     * @return
     */
    @Override
    public boolean insertAttr(BuildingsAttribute buildingsAttribute) {
        return this.officeBuildingMapper.insertAttr(buildingsAttribute);
    }

    @Override
    public List<Map<String, Object>> queryOfficeBuilding(QueryAnalyzer buildingQueryAnalyzer) {
        return this.officeBuildingMapper.queryOfficeBuilding(buildingQueryAnalyzer);
    }

    /**
     * 前端列表页信息
     * @param queryAnalyzerOffice
     * @return
     */
    @Override
    public List<OfficeBHVO> queryOfficeBH(QueryAnalyzerOffice queryAnalyzerOffice) {
        return this.officeBuildingMapper.queryOfficeBH(queryAnalyzerOffice);
    }

    @Override
    public List<OfficeBHVO> queryOfficeByLatLon(QueryAnalyzerOffice queryAnalyzerNmapVO) {
        return this.officeBuildingMapper.queryOfficeByLatLon(queryAnalyzerNmapVO);
    }
}
